package com.yj.consumer.table;

import javax.xml.crypto.Data;
import java.util.List;

/**
 *
 */
public class PageTableResponse<T> {
    private int total;
    private List<T> data;
    private int limit;
    private int current;

    //分页显示数据
    public PageTableResponse(List<T> data,int current,int limit){
        this(data.subList((current-1)*limit,(current-1)*limit+limit),current,limit,data.size());
    }

    public PageTableResponse(List<T> data,int current,int limit,int total){
        this.data = data;
        this.current = current;
        this.limit = limit;
        this.total = total;
    }

    //显示所有的数据
    public PageTableResponse(List <T> data){
        this(data,0,0,0);
    }


}
